home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsISocketTransport.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  10KB  |  281 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsISocketTransport.idl
  3.  */
  4.  
  5. #ifndef __gen_nsISocketTransport_h__
  6. #define __gen_nsISocketTransport_h__
  7.  
  8.  
  9. #ifndef __gen_nsITransport_h__
  10. #include "nsITransport.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIInterfaceRequestor; /* forward declaration */
  18.  
  19. class nsISocketEventSink; /* forward declaration */
  20.  
  21.  
  22. /* starting interface:    nsISocketTransport */
  23. #define NS_ISOCKETTRANSPORT_IID_STR "66418cc8-5f5d-4f52-a7f9-db8fb3b2cfe6"
  24.  
  25. #define NS_ISOCKETTRANSPORT_IID \
  26.   {0x66418cc8, 0x5f5d, 0x4f52, \
  27.     { 0xa7, 0xf9, 0xdb, 0x8f, 0xb3, 0xb2, 0xcf, 0xe6 }}
  28.  
  29. /**
  30.  * nsISocketTransport
  31.  *
  32.  * NOTE: This is a free-threaded interface, meaning that the methods on
  33.  * this interface may be called from any thread.
  34.  */
  35. class NS_NO_VTABLE nsISocketTransport : public nsITransport {
  36.  public: 
  37.  
  38.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOCKETTRANSPORT_IID)
  39.  
  40.   /**
  41.      * Get the host for the underlying socket connection.
  42.      */
  43.   /* readonly attribute AUTF8String host; */
  44.   NS_IMETHOD GetHost(nsACString & aHost) = 0;
  45.  
  46.   /**
  47.      * Get the port for the underlying socket connection.
  48.      */
  49.   /* readonly attribute long port; */
  50.   NS_IMETHOD GetPort(PRInt32 *aPort) = 0;
  51.  
  52.   /** 
  53.      * Returns the IP address of the socket connection peer. This
  54.      * attribute is defined only once a connection has been established.
  55.      */
  56.   /* [noscript] PRNetAddr getPeerAddr (); */
  57.   NS_IMETHOD GetPeerAddr(union PRNetAddr *_retval) = 0;
  58.  
  59.   /** 
  60.      * Returns the IP address of the initiating end. This attribute
  61.      * is defined only once a connection has been established.
  62.      */
  63.   /* [noscript] PRNetAddr getSelfAddr (); */
  64.   NS_IMETHOD GetSelfAddr(union PRNetAddr *_retval) = 0;
  65.  
  66.   /**
  67.      * Security info object returned from the secure socket provider.  This
  68.      * object supports nsISSLSocketControl, nsITransportSecurityInfo, and
  69.      * possibly other interfaces.
  70.      */
  71.   /* readonly attribute nsISupports securityInfo; */
  72.   NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) = 0;
  73.  
  74.   /**
  75.      * Security notification callbacks passed to the secure socket provider
  76.      * via nsISSLSocketControl at socket creation time.
  77.      *
  78.      * NOTE: this attribute cannot be changed once a stream has been opened.
  79.      */
  80.   /* attribute nsIInterfaceRequestor securityCallbacks; */
  81.   NS_IMETHOD GetSecurityCallbacks(nsIInterfaceRequestor * *aSecurityCallbacks) = 0;
  82.   NS_IMETHOD SetSecurityCallbacks(nsIInterfaceRequestor * aSecurityCallbacks) = 0;
  83.  
  84.   /**
  85.      * Test if this socket transport is (still) connected.
  86.      */
  87.   /* boolean isAlive (); */
  88.   NS_IMETHOD IsAlive(PRBool *_retval) = 0;
  89.  
  90.   /**
  91.      * Socket timeouts in seconds.  To specify no timeout, pass PR_UINT32_MAX
  92.      * as aValue to setTimeout.  The implementation may truncate timeout values
  93.      * to a smaller range of values (e.g., 0 to 0xFFFF).
  94.      */
  95.   /* unsigned long getTimeout (in unsigned long aType); */
  96.   NS_IMETHOD GetTimeout(PRUint32 aType, PRUint32 *_retval) = 0;
  97.  
  98.   /* void setTimeout (in unsigned long aType, in unsigned long aValue); */
  99.   NS_IMETHOD SetTimeout(PRUint32 aType, PRUint32 aValue) = 0;
  100.  
  101.   /**
  102.      * Values for the aType parameter passed to get/setTimeout.
  103.      */
  104.   enum { TIMEOUT_CONNECT = 0U };
  105.  
  106.   enum { TIMEOUT_READ_WRITE = 1U };
  107.  
  108.   /**
  109.      * nsITransportEventSink status codes.
  110.      *
  111.      * Although these look like XPCOM error codes and are passed in an nsresult
  112.      * variable, they are *not* error codes.  Note that while they *do* overlap
  113.      * with existing error codes in Necko, these status codes are confined
  114.      * within a very limited context where no error codes may appear, so there
  115.      * is no ambiguity.
  116.      *
  117.      * The values of these status codes must never change.
  118.      *
  119.      * The status codes appear in near-chronological order (not in numeric
  120.      * order).  STATUS_RESOLVING may be skipped if the host does not need to be
  121.      * resolved.  STATUS_WAITING_FOR is an optional status code, which the impl
  122.      * of this interface may choose not to generate.
  123.      */
  124.   enum { STATUS_RESOLVING = 2152398851U };
  125.  
  126.   enum { STATUS_CONNECTING_TO = 2152398855U };
  127.  
  128.   enum { STATUS_CONNECTED_TO = 2152398852U };
  129.  
  130.   enum { STATUS_SENDING_TO = 2152398853U };
  131.  
  132.   enum { STATUS_WAITING_FOR = 2152398858U };
  133.  
  134.   enum { STATUS_RECEIVING_FROM = 2152398854U };
  135.  
  136. };
  137.  
  138. /* Use this macro when declaring classes that implement this interface. */
  139. #define NS_DECL_NSISOCKETTRANSPORT \
  140.   NS_IMETHOD GetHost(nsACString & aHost); \
  141.   NS_IMETHOD GetPort(PRInt32 *aPort); \
  142.   NS_IMETHOD GetPeerAddr(union PRNetAddr *_retval); \
  143.   NS_IMETHOD GetSelfAddr(union PRNetAddr *_retval); \
  144.   NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo); \
  145.   NS_IMETHOD GetSecurityCallbacks(nsIInterfaceRequestor * *aSecurityCallbacks); \
  146.   NS_IMETHOD SetSecurityCallbacks(nsIInterfaceRequestor * aSecurityCallbacks); \
  147.   NS_IMETHOD IsAlive(PRBool *_retval); \
  148.   NS_IMETHOD GetTimeout(PRUint32 aType, PRUint32 *_retval); \
  149.   NS_IMETHOD SetTimeout(PRUint32 aType, PRUint32 aValue); \
  150.  
  151. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  152. #define NS_FORWARD_NSISOCKETTRANSPORT(_to) \
  153.   NS_IMETHOD GetHost(nsACString & aHost) { return _to GetHost(aHost); } \
  154.   NS_IMETHOD GetPort(PRInt32 *aPort) { return _to GetPort(aPort); } \
  155.   NS_IMETHOD GetPeerAddr(union PRNetAddr *_retval) { return _to GetPeerAddr(_retval); } \
  156.   NS_IMETHOD GetSelfAddr(union PRNetAddr *_retval) { return _to GetSelfAddr(_retval); } \
  157.   NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) { return _to GetSecurityInfo(aSecurityInfo); } \
  158.   NS_IMETHOD GetSecurityCallbacks(nsIInterfaceRequestor * *aSecurityCallbacks) { return _to GetSecurityCallbacks(aSecurityCallbacks); } \
  159.   NS_IMETHOD SetSecurityCallbacks(nsIInterfaceRequestor * aSecurityCallbacks) { return _to SetSecurityCallbacks(aSecurityCallbacks); } \
  160.   NS_IMETHOD IsAlive(PRBool *_retval) { return _to IsAlive(_retval); } \
  161.   NS_IMETHOD GetTimeout(PRUint32 aType, PRUint32 *_retval) { return _to GetTimeout(aType, _retval); } \
  162.   NS_IMETHOD SetTimeout(PRUint32 aType, PRUint32 aValue) { return _to SetTimeout(aType, aValue); } \
  163.  
  164. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  165. #define NS_FORWARD_SAFE_NSISOCKETTRANSPORT(_to) \
  166.   NS_IMETHOD GetHost(nsACString & aHost) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHost(aHost); } \
  167.   NS_IMETHOD GetPort(PRInt32 *aPort) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPort(aPort); } \
  168.   NS_IMETHOD GetPeerAddr(union PRNetAddr *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPeerAddr(_retval); } \
  169.   NS_IMETHOD GetSelfAddr(union PRNetAddr *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelfAddr(_retval); } \
  170.   NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityInfo(aSecurityInfo); } \
  171.   NS_IMETHOD GetSecurityCallbacks(nsIInterfaceRequestor * *aSecurityCallbacks) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityCallbacks(aSecurityCallbacks); } \
  172.   NS_IMETHOD SetSecurityCallbacks(nsIInterfaceRequestor * aSecurityCallbacks) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSecurityCallbacks(aSecurityCallbacks); } \
  173.   NS_IMETHOD IsAlive(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsAlive(_retval); } \
  174.   NS_IMETHOD GetTimeout(PRUint32 aType, PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTimeout(aType, _retval); } \
  175.   NS_IMETHOD SetTimeout(PRUint32 aType, PRUint32 aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTimeout(aType, aValue); } \
  176.  
  177. #if 0
  178. /* Use the code below as a template for the implementation class for this interface. */
  179.  
  180. /* Header file */
  181. class nsSocketTransport : public nsISocketTransport
  182. {
  183. public:
  184.   NS_DECL_ISUPPORTS
  185.   NS_DECL_NSISOCKETTRANSPORT
  186.  
  187.   nsSocketTransport();
  188.  
  189. private:
  190.   ~nsSocketTransport();
  191.  
  192. protected:
  193.   /* additional members */
  194. };
  195.  
  196. /* Implementation file */
  197. NS_IMPL_ISUPPORTS1(nsSocketTransport, nsISocketTransport)
  198.  
  199. nsSocketTransport::nsSocketTransport()
  200. {
  201.   /* member initializers and constructor code */
  202. }
  203.  
  204. nsSocketTransport::~nsSocketTransport()
  205. {
  206.   /* destructor code */
  207. }
  208.  
  209. /* readonly attribute AUTF8String host; */
  210. NS_IMETHODIMP nsSocketTransport::GetHost(nsACString & aHost)
  211. {
  212.     return NS_ERROR_NOT_IMPLEMENTED;
  213. }
  214.  
  215. /* readonly attribute long port; */
  216. NS_IMETHODIMP nsSocketTransport::GetPort(PRInt32 *aPort)
  217. {
  218.     return NS_ERROR_NOT_IMPLEMENTED;
  219. }
  220.  
  221. /* [noscript] PRNetAddr getPeerAddr (); */
  222. NS_IMETHODIMP nsSocketTransport::GetPeerAddr(union PRNetAddr *_retval)
  223. {
  224.     return NS_ERROR_NOT_IMPLEMENTED;
  225. }
  226.  
  227. /* [noscript] PRNetAddr getSelfAddr (); */
  228. NS_IMETHODIMP nsSocketTransport::GetSelfAddr(union PRNetAddr *_retval)
  229. {
  230.     return NS_ERROR_NOT_IMPLEMENTED;
  231. }
  232.  
  233. /* readonly attribute nsISupports securityInfo; */
  234. NS_IMETHODIMP nsSocketTransport::GetSecurityInfo(nsISupports * *aSecurityInfo)
  235. {
  236.     return NS_ERROR_NOT_IMPLEMENTED;
  237. }
  238.  
  239. /* attribute nsIInterfaceRequestor securityCallbacks; */
  240. NS_IMETHODIMP nsSocketTransport::GetSecurityCallbacks(nsIInterfaceRequestor * *aSecurityCallbacks)
  241. {
  242.     return NS_ERROR_NOT_IMPLEMENTED;
  243. }
  244. NS_IMETHODIMP nsSocketTransport::SetSecurityCallbacks(nsIInterfaceRequestor * aSecurityCallbacks)
  245. {
  246.     return NS_ERROR_NOT_IMPLEMENTED;
  247. }
  248.  
  249. /* boolean isAlive (); */
  250. NS_IMETHODIMP nsSocketTransport::IsAlive(PRBool *_retval)
  251. {
  252.     return NS_ERROR_NOT_IMPLEMENTED;
  253. }
  254.  
  255. /* unsigned long getTimeout (in unsigned long aType); */
  256. NS_IMETHODIMP nsSocketTransport::GetTimeout(PRUint32 aType, PRUint32 *_retval)
  257. {
  258.     return NS_ERROR_NOT_IMPLEMENTED;
  259. }
  260.  
  261. /* void setTimeout (in unsigned long aType, in unsigned long aValue); */
  262. NS_IMETHODIMP nsSocketTransport::SetTimeout(PRUint32 aType, PRUint32 aValue)
  263. {
  264.     return NS_ERROR_NOT_IMPLEMENTED;
  265. }
  266.  
  267. /* End of implementation class template. */
  268. #endif
  269.  
  270. /**
  271.  * #define's for compatibility
  272.  */
  273. #define NS_NET_STATUS_RESOLVING_HOST nsISocketTransport::STATUS_RESOLVING
  274. #define NS_NET_STATUS_CONNECTED_TO   nsISocketTransport::STATUS_CONNECTED_TO
  275. #define NS_NET_STATUS_SENDING_TO     nsISocketTransport::STATUS_SENDING_TO
  276. #define NS_NET_STATUS_RECEIVING_FROM nsISocketTransport::STATUS_RECEIVING_FROM
  277. #define NS_NET_STATUS_CONNECTING_TO  nsISocketTransport::STATUS_CONNECTING_TO
  278. #define NS_NET_STATUS_WAITING_FOR    nsISocketTransport::STATUS_WAITING_FOR
  279.  
  280. #endif /* __gen_nsISocketTransport_h__ */
  281.